import { HTTP } from '../utils/http-p.js'

class UserModel extends HTTP{
  key = 'q'

  getUserIndex(userId){
    return this.request({
      url: '/v/user/getUserIndex',
      data: {
        userId: userId
      }
    })
  }

  checkUserInfo() {
    return this.request({
      url: '/v/user/checkUserInfo',
      data: {
       
      }
    })
  }

  getUserWorks(start,userId) {
    return this.request({
      url: '/v/user/getUserWorksList',
      data: {
        start: start,
        userId: userId
      }
    })
  }

  getUserShootList(start,userId) {
    return this.request({
      url: '/v/user/getUserShootList',
      data: {
        start: start,
        userId: userId
      }
    })
  }

  getWorksImageList(start,userId) {
    return this.request({
      url: '/v/user/getWorksImageList',
      data: {
        start: start,
        userId: userId
      }
    })
  }

  getFollowList(start) {
    return this.request({
      url: '/v/user/getFollowList',
      data: {
        start: start
      }
    })
  }

  getFansList(start) {
    return this.request({
      url: '/v/user/getFansList',
      data: {
        start: start
      }
    })
  }

  addOpinion(opinion) {
    return this.request({
      url: '/v/user/addOpinion',
      data: {
        opinion: opinion
      }
    })
  }

  getUserInfo() {
    return this.request({
      url: '/v/user/getUserInfo',
    })
  }

  updateUser(params) {
    return this.request({
      url: '/v/user/updateUser',
      method:'POST',
      data:{
        gender:params.gender,
        avatarUrl:params.avatarUrl,
        birthday:params.birthday,
        region:params.region,
        province:params.province,
        capacity:params.capacity,
        phone:params.phone,
        weChat:params.weChat,
        weibo:params.weibo,
      }
    })
  }

}

export { UserModel}
